import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter)


export const routes1 = [
  {
    path:"/userRole",
    name:'UserRole',
    mate:{
      title: "用户角色管理",
    },
    children:[
      {
        path:"/user",
        name:'User',
        mate:{
          title: "用户管理",
        },
        component: () => import('../views/User/user.vue'),
      },
      {
        path:"/role",
        name:'Role',
        mate:{
          title: "角色管理",
        },
        component: () => import('../views/Role/role.vue'),
      },
    ]
    
  },
]

export const routes = [
  {
    path:"/",
    name:'MainT',
    mate:{
      title: "首页",
    },
    components: {
      default: () => import('../views/MainT.vue'),
    },
    
    // component: () => import('../views/MainT.vue'),
  },
  
  // =================================监管系统===========================
  {
    path:"/jGIndex",
    name:'JGIndex',
    mate:{
      title: '监管系统首页'
    },
    components: {
      default: () => import('../views/JGList/JGIndex.vue'),
    },
    redirect:'/user',
    // component: () => import('../views/JGList/JGIndex.vue'),
    children:[
      {
        path:"/user",
        name:'User',
        mate:{
          title: "用户管理",
          icon: "el-icon-user-solid"
        },
        components: { 
          JGSystem: () => import('@/views/User/user.vue') 
        },
      },
      {
        path:"/role",
        name:'Role',
        mate:{
          title: "角色管理",
          icon: "el-icon-s-custom",
        },
        components: { 
          JGSystem: () => import('@/views/Role/role.vue') 
        },
      },
      {
        path:"/target",
        name:'Target',
        mate:{
          title: "指标管理",
          icon: "el-icon-s-data",
        },
        components: { 
          JGSystem: () => import('@/views/target/target.vue') 
        },
      },
      
      {
        path:"/targetSort",
        name:'TargetSort',
        mate:{
          title: "指标分类管理",
          icon: "el-icon-menu",
        },
        components: { 
          JGSystem: () => import('@/views/target/targetSort.vue') 
        },
      },
      {
        path:"/forewariningModel",
        name:'forewariningModel',
        mate:{
          title: "预警模型管理",
          icon: "el-icon-s-finance",
        },
        components: { 
          JGSystem: () => import('@/views/forewarning/forewariningModel.vue') 
        },
      },
      {
        path:"/forewariningHandle",
        name:'ForewariningHandle',
        mate:{
          title: "预警处理",
          icon: "el-icon-s-claim",
        },
        components: { 
          JGSystem: () => import('@/views/forewarning/forewariningHandle.vue') 
        },
      },
      

    ]
  },
  //  ==========================省市区地图=====================
  // {
  //   path:"/china",
  //   name:'China',
  //   mate:{
  //     title: '中国'
  //   },
  //   components: {
  //     echartsGo: () => import('../views/part/components/china.vue'),
  //   },
  // },
  // {
  //   path:"/province",
  //   name:'Province',
  //   mate:{
  //     title: '省份'
  //   },
  //   components: {
  //     echartsGo: () => import('../views/part/components/province.vue'),
  //   },
  // },
  
  
]

// 路由加载不了的
// {
  // {
      //   path:"/userRole",
      //   name:'UserRole',
      //   mate:{
      //     title: "用户角色管理",
      //   },
      //   children:[
      //     {
      //       path:"/user",
      //       name:'User',
      //       mate:{
      //         title: "用户管理",
      //       },
      //       components: { 
      //         JGSystem: () => import('@/views/User/user.vue') 
      //       },
      //     },
      //     {
      //       path:"/role",
      //       name:'Role',
      //       mate:{
      //         title: "角色管理",
      //       },
      //       components: { 
      //         JGSystem: () => import('@/views/User/role.vue') 
      //       },
      //     },
      //   ]
        
      // },
// }


const router = new VueRouter({
  mode:'history',
  routes,
  routes1,
})

export default router